<template>
    <div class="not-found">
        <div class="box-404-wrap">
            <div class="box">
                <!-- <h1>404</h1>
                <h1>NotFound</h1> -->
                <img src="../assets/404.jpg" alt="">
                <div class="text-center "><span style="color: var(--color-primary);">{{ router.currentRoute.value.fullPath }}</span> 页面不存在或者您没有权限访问。</div>
                <div class="d-flex">
                    
                    <div class="mt-4"><a @click="backView" role="button" tabindex="0"
                            class="btn btn-primary">返回</a></div>
                    <div class="mt-4"><a href="/" role="button" tabindex="0"
                            class="btn btn-primary">回首页</a></div>
                </div>
            </div>
        </div>
    </div>
</template>
<script setup>
import { useRouter } from 'vue-router';

const router = useRouter();

const backView = () => {
    // 返回上一页
    router.back();
}
</script>
<style scoped lang="scss">
.not-found {
    text-align: center;
    color: red;

    h1 {
        // font-size: 20px;

    }
    // 生成该组件的样式
    .box-404-wrap {
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 30px;
        .box {
            width: 100%;
            max-width: 400px;
            padding: 20px;
            border-radius: 10px;
            background-color: #fff;
            box-shadow: 0 0 10px #ccc;
            img {
                width: 100%;
                height: auto;
                margin-bottom: 20px;
            }
            .text-center {
                font-size: 16px;
                font-weight: 700;
                color: #333;
                margin-bottom: 30px;
            }

            .d-flex {
                display: flex;
                justify-content: space-between;
                align-items: center;
            }
            
            .btn {
                padding: 10px 20px;
                border-radius: 5px;
                font-size: 14px;
                font-weight: 700;
                color: #fff;
                background-color: #007bff;
                border-color: #007bff;
                &:hover {
                    color: #fff;
                    background-color: #0069d9;
                    border-color: #0062cc;
                }
            }
        }
    }
    
}
</style>